Skip to content

minor: Add segment debug logging to CachingClusteredClient#19648

Open
cecemei wants to merge 5 commits into
apache:masterfrom
cecemei:metric3
Open

minor: Add segment debug logging to CachingClusteredClient#19648
cecemei wants to merge 5 commits into
apache:masterfrom
cecemei:metric3

Conversation

@cecemei

@cecemei cecemei commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

When debugging slow or incorrect queries on the broker, it's useful to know how many segments were found during timeline lookup and how they break down by interval, version, and server type (realtime vs historical).


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@cecemei cecemei marked this pull request as ready for review July 1, 2026 19:25
Comment thread server/src/main/java/org/apache/druid/client/CachingClusteredClient.java Outdated
Comment thread server/src/main/java/org/apache/druid/client/CachingClusteredClient.java Outdated
Comment thread server/src/main/java/org/apache/druid/client/CachingClusteredClient.java Outdated
@cecemei cecemei requested review from clintropolis and kfaraz July 1, 2026 20:59

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.

Reviewed 1 of 1 changed files.


This is an automated review by Codex GPT-5.5

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1

Reviewed 1 of 1 changed files.

Found 1 issue: debug logging can emit synthetic segment IDs for sliced timeline lookups.


This is an automated review by Codex GPT-5.5

segmentServers.stream().map(
s -> SegmentId.of(
dataSource,
s.getSegmentDescriptor().getInterval(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Log real segment IDs, not query slices

The debug log rebuilds a SegmentId from SegmentDescriptor.getInterval(), but computeSegmentsToQuery fills that descriptor from TimelineObjectHolder.getInterval(). VersionedIntervalTimeline.lookup trims the first or last holder to the requested interval, so a query over one day inside a week-long segment logs a synthetic segment id that never existed. Use s.getServer().getSegment().getId() for the segment id, and log the query interval separately if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants